/* filter.h */

/********************/
/* AUDIO-FILTERING  */
/* for Secure Phone */
/* (C) 2003 by NAH6 */
/********************/

#ifndef __FILTER_H
#define __FILTER_H
#ifdef __cplusplus
extern "C" {
#endif

/*-----------*/
/*  DEFINES  */
/*-----------*/

#define E_FILTER_NULLPTR       (-0x7301)
#define E_FILTER_SAMPLERATE    (-0x7302)

/*====*/

#define K_FILTER_SAMPLERATES         (8)
#define K_FILTER_SAMPLERATE_8000     (0)
#define K_FILTER_SAMPLERATE_11025    (1)
#define K_FILTER_SAMPLERATE_16000    (2)
#define K_FILTER_SAMPLERATE_22050    (3)
#define K_FILTER_SAMPLERATE_24000    (4)
#define K_FILTER_SAMPLERATE_32000    (5)
#define K_FILTER_SAMPLERATE_44100    (6)
#define K_FILTER_SAMPLERATE_48000    (7)

#define K_FILTER_CHUNKSIZE_8K       (80)
#define K_FILTER_CHUNKSIZE_11K     (110)
#define K_FILTER_CHUNKSIZE_16K     (160)
#define K_FILTER_CHUNKSIZE_22K     (220)
#define K_FILTER_CHUNKSIZE_24K     (240)
#define K_FILTER_CHUNKSIZE_32K     (320)
#define K_FILTER_CHUNKSIZE_44K     (441)
#define K_FILTER_CHUNKSIZE_48K     (480)

#define K_FILTER_HISTORYLEN         (17)

/*--------------*/
/*  PROTOTYPES  */
/*--------------*/

signed short filter_resample_xto8 (const signed short *in, signed short *out, \
                                   unsigned char rate);
signed short filter_resample_8tox (const signed short *in, signed short *out, \
                                   unsigned char rate);

/*-------------*/
/*  VARIABLEN  */
/*-------------*/

extern const unsigned short filter_samplerate[K_FILTER_SAMPLERATES];
extern const unsigned short filter_chunklen  [K_FILTER_SAMPLERATES];

#ifdef __cplusplus
}
#endif
#endif


/*** EOF ***/
